package com.trg.designmodel.template;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName: SoyaMilk
 * @Description:
 * @Author: tangrg
 * @Date: 2021/7/20 14:26
 * @Version: 1.0
 * @Return:
 **/
public abstract class AbstractSoyaMilk {

    private static final Logger log = LoggerFactory.getLogger(AbstractSoyaMilk.class);

    void select() {
        log.info("开始选择材料！");
    }

    /**
     * 可以由子类进行重写
     */
    abstract void add();

    void soak() {
        log.info("浸泡材料中。。。");
    }

    void beat() {
        log.info("豆浆机进行打磨豆浆！");
    }

    void make() {
        log.info("开始制作豆浆中。。。");
        select();
        if(isAdd()){
            add();
        }
        soak();
        beat();
    }
      Boolean isAdd(){
        return false;
    }

}
